package exercise;

import java.util.LinkedList;
import java.util.function.Consumer;

/**
 * @classname:LinkedList
 * @description:
 * @author: Mr.Z
 * @date: 2020/12/12 19:46
 * @version: 0.1
 * @since:1.8
 */
public class LinkedListDemo {
    public static void main(String[] args) {
        LinkedList<Integer> linkedList = new LinkedList<>();
        linkedList.add(100);
        linkedList.addFirst(20);
        linkedList.forEach(new Consumer<Integer>() {
            @Override
            public void accept(Integer integer) {
                System.out.println(integer);
            }
        });

    }
}
